<template>
  <div class="table">
    <el-button @click="add()">添加</el-button>
<!--    <el-table :data="tableData"  border>
      <el-table-column prop="id" label="编号" width="100" />
      <el-table-column prop="filename" label="名称" width="100" >
        &lt;!&ndash;v-for="filename in tableData" :key="filename"&ndash;&gt;
        <el-link href="https://element.eleme.io">123</el-link>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button size="mini" @click="edit(scope.row)" icon="el-icon-edit">编辑</el-button>
          <el-button size="mini" type="danger" @click="centerDialogVisible = true">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
 -->
    <table  border="1">
      <tr>
        <th width="30px">编号</th>
        <th width="200px">文件名</th>
        <th width="100px">操作</th>
      </tr>
        <tr v-for="testvo in tableData" :key="testvo">
          <th width="30px">{{testvo.id}}</th>
          <th width="200px"><a href="#">{{testvo.filename}}</a></th>
          <th width="200px">

            <button :onclick="del">删除</button>
          </th>
        </tr>
    </table>

  </div>
</template>

<script>
  export default {
    name: 'List',
    data() {
      return {
        tableData: [
          {
            id: "",
            filename: "",
          }
        ],
        testvo: {
          id: "testvo_id",
          filename: "testvo_filename",
        },
      }
    },
    created: function() {
      this.GetPhoneInfo()
    },
    methods: {
      GetPhoneInfo() {
        const constinfo = this.$http
          .get('test/test')
          .then(tm => {
            this.tableData = tm.data
            console.log(this.tableData)
          })
          .catch(error => {
            console.log(error)
          })
      },
      del() {

      }

    }
  }
</script>
